{**
 * DMTK.tpl: hien thi cho xem cac tai khoan trong DMuc
 *
 *}

{strip}
{assign var="pageTitle" value="Danh muc Vật tư"}
{assign var="socot" value="7"}
{include file="common/header.tpl"}
{url|assign:"InsUrl" op="DMVT_Ins"}

{/strip}


<div class = "DMtitle" >
<strong>DANH MỤC VẬT TƯ</strong>
</div>
<div class = "search" id = "search">
{foreach from=$alphaList item=letter}<a href="javascript:void(0);" onclick="refreshDMVT('{$letter|escape}', '{$url}');">{if $letter == $dmvt_initial}{$letter|escape}{else}{$letter|escape}{/if}</a> {/foreach}
<br>
<br>


<form method="post" action="{url page='acctKT' op='KT_DANHMUC' ChiTiet = 'VT'}">
<select name="searchField" size="1" class="selectMenu">
		{html_options options=$fieldOptions selected=$searchField}
	</select>
	<select name="searchMatch" size="1" class="selectMenu">
		<option value="contains"{if $searchMatch == 'contains'} selected="selected"{/if}>C&#243; ch&#7913;a</option>
		<option value="is"{if $searchMatch == 'is'} selected="selected"{/if}>L&#224;</option>
		<option value="startsWith"{if $searchMatch == 'startsWith'} selected="selected"{/if}>B&#7855;t &#273;&#7847;u l&#224; </option>
	</select>

	<input type="text" size="10" name="search" class="textField" value="{$search|escape}" />&nbsp;<input type="submit" value="{translate key="common.search"}" class="button" />
	</form>

</div>

<div id = "create" style="display: none; width:80%;  margin-left: auto; margin-right: auto;">
	<table width="100%" style = " border: thin black solid;">
	<tr valign="top" height = "40px">
	<td colspan = "2" id = "create_title" width="100%" style = "text-align: center; padding: 10px 20px ; width:100%; color: #458B74;font-size: 1.5em; font-weight: bold; border-width: 0;" > Thêm Vật tư mới</td>
	</tr>

	<tr valign="top">
		<td width="20%" class="label" style = "text-align: right;"><label for="mavt">M&#227; Vật tư:*</label></td>
		<td width="80%" class="value"><input type="text" name="mavt" value="{$mavt}" id="mavt" size="40" maxlength="70" class="textField" /></td>
	</tr>

	<tr valign="top">
		<td width="20%" class="label" style = "text-align: right;"><label for="tenvt">Tên Vật tư:*</label></td>
		<td width="80%" class="value"><input type="text" name="tenvt" value="{$tenvt}" id="tenvt" size="40" style="width:99%" class="textField" /></td>
	</tr>

	<tr valign="top">
		<td width="20%" class="label" style = "text-align: right;"><label for="tenvt">Đơn vị tính: </label></td>
		<td width="80%" class="value"><input type="text" name="dvt" value="{$dvt}" id="dvt" size="40" style="width:99%" class="textField" /></td>
	</tr>

	<tr valign="top">
		<td width="20%" class="label" style = "text-align: right;"><label for="tk_vt">TK Vật tư: </label></td>
		<td class="value">
		<select name="tk_vt" id="tk_vt" class="selectMenu">
		{html_options options=$dstkvt selected=$tk_vt}
		</select>
	</td>

		
	</tr>

	<tr valign="top">
	
		<td width="20%" class="label" style = "text-align: right;"><label for="tk_gv">TK Giá vốn: </label></td>
		<td width="80%" class="value">		<select name="tk_gv" id="tk_vgv" class="selectMenu">
		{html_options options=$dstkgv selected=$tk_gv}
		</select>
	</td>
	</tr>


	<tr valign="top">
		<td width="20%" class="label" style = "text-align: right;"><label for="tk_dt">TK Doanh thu: </label></td>
		<td width="80%" class="value">		
		<select name="tk_dt" id="tk_dt" class="selectMenu">
		{html_options options=$dstkdt selected=$tk_dt}
		</select>
		</td>
	</tr>

	<tr valign="top">



	</tr>

	<tr valign="top" height = "40px">
	<td colspan = "2" width="100%" style = "text-align: center; padding: 10px 20px ; width:100%; color: #458B74;font-weight: bold;"> 
	
	<input type="button" id = "createbutton" value="Thêm mới" class="button defaultButton" onclick="SaveDMVT('{$InsUrl}');" /> <input type="button" value="{translate key="common.cancel"}" class="button defaultButton" onclick="RTFcreate();" />
	</td></tr>

	</table>
	<br>
	<br>
</div> 


<table width = "100%">
<tr>
<td width = "50%">
	<div id = "btnThem"> 
	<input type="button" id="button_id" value="Th&#234;m Vật tư mới"  class="button" style= "text-align: left;"  onClick="create();"> 
	</div>
</td>
</tr>
</table>

<div id="sections">

<table width="100%" id="customers">
	<tr valign="bottom">
		<th width="15%">Mã Vật tư </th>
		<th width="45%">Tên Vật tư</th>
		<th width="7%">ĐVT</th>
		<th width="10%">TK VT</th>
		<th width="10%">TK GVốn</th>
		<th width="10%">TK Dthu</th>
		<th width="10%" align="right">{translate key="common.action"}</th>
	</tr>

	

{assign var="stt" value="0"}
<p align = "right" id = "danhmucDV_ND" style="color: #0000FF; font-size: 1em"> {$dktim}</b> # {$dmvtas|@count} dòng# ^F: Tìm kiếm </p>
 
{foreach from=$dmvtas item=dmvts}
	<tr valign="top" >
			
	<td class="drag">{$dmvts.MAVT|escape}</td>
	<td class="drag">{$dmvts.TENVT|escape}</td>
	<td class="drag">{$dmvts.DVT|escape}</td>
	<td class="drag">{$dmvts.TK_VT|escape}</td>
	<td class="drag">{$dmvts.TK_GV|escape}</td>
	<td class="drag">{$dmvts.TK_DT|escape}</td>

	<td align="right" class="nowrap">

	<a href="#" class="action" onclick="editDMVT('{$dmvts.MAVT}', '{$dmvts.TENVT|escape}', '{$dmvts.DVT|escape}', '{$dmvts.TK_DT}', '{$dmvts.TK_VT|escape}', '{$dmvts.TK_GV|escape}')">{translate key="common.edit"}</a>&nbsp;|&nbsp;<a href="{url op="DMVT_Del" path=$dmvts.MAVT}" onclick="return confirm('Ban muon xoa {$dmvts.MAVT}?')" class="action">{translate key="common.delete"}</a>
	</td>

	
	</tr>
{/foreach}

{*
{iterate from=dmvtas item=dmvt name=dmvts}
	{if $stt ==0}
		{assign var="stt" value="1"}
		<tr valign="top" >
			{assign var = "mavt" value = $dmvt->getmavt()}
			<td class="drag">{$dmvt['MAVT']()|escape}</td>
			<td class="drag">{$dmvt['TENVT']()|escape}</td>
			<td class="drag"></td>
			<td align="right" class="nowrap">
				<a href="{url op="editdmvt" path=$dmvt->getmavt()}" class="action">{translate key="common.edit"}</a>&nbsp;|&nbsp;<a href="{url op="deletedmvt" path=$dmvt->getmavt()}" onclick="return confirm('{translate|escape:"jsparam" key={"Xoa Tai Khoan  $mavt"}}')" class="action">{translate key="common.delete"}</a>
			</td>
		</tr>
	{else}
		{assign var="stt" value="0"}
		<tr valign="top" class="alt">
			{assign var = "mavt" value = $dmvt->getmavt()}
			<td class="drag">{$dmvt->getmavt()|escape}</td>
			<td class="drag">{$dmvt->gettenvt()|escape}</td>
			<td class="drag"></td>
			<td align="right" class="nowrap">
				<a href="{url op="editdmvt" path=$dmvt->getmavt()}" class="action">{translate key="common.edit"}</a>&nbsp;|&nbsp;<a href="{url op="deletedmvt" path=$dmvt->getmavt()}" onclick="return confirm('{translate|escape:"jsparam" key={"Xoa Tai Khoan  $mavt"}}')" class="action">{translate key="common.delete"}</a>
			</td>
		</tr>
	{/if}

{/iterate}
*}



<tr>
	<td colspan="{$socot}" class="endseparator">&nbsp;</td>
</tr>

</table>
</div>

{include file="common/footer.tpl"}

